package Zombies;

import java.awt.Graphics;
import java.awt.Graphics2D;
import javax.swing.ImageIcon;
import javax.swing.JPanel;

/**
 * Autores:
 * Hugo Hiroshi Yamamura
 * Marina Coimbra Viviani
 */
public class Haunter extends Zombie {
    
    private String zombie = "/Sprites/haunter.gif";;
    private int type = 4;
    
 /**
 * Construtor: Haunter
 * Constroi novo Haunter.
 */


/**
 * Classe: Gyarardos
 * Zumbi tipo fantasma (perde para o pikachu, pokemon sagrado).
 *
 */
    public Haunter(){   
    
        ImageIcon ii = new ImageIcon(this.getClass().getResource(zombie));
        this.setImage(ii.getImage());
        this.setWidth(this.getImage().getHeight(null));
        this.setHeight(this.getImage().getHeight(null));
        this.setImagew(36);
        this.setVisible(true);
        this.type = 4;

       
    }
     /*
    *
    * Metodo: paint
    * Funcionamento: pinta o Haunter no JPanel.
    */
    @Override
    public void paint(Graphics g, JPanel panel){
        if(this.isVisible()){
            Graphics2D g2d = (Graphics2D)g;
            g2d.drawImage(this.getImage(), this.getX(), this.getY(), this.getX()+ this.getImagew(), this.getY() + this.getHeight(), this.getImagex(), 0, this.getImagex()+ this.getImagew(), this.getHeight(), panel);
        }
    }
    /*
    *
    * Metodo: dealCollision
    * Funcionamento: lida com a colisão do Haunter com pokebola, personagem principal e a casa, se colidium desaparece da tela
    */
    @Override
    public void dealCollision(){
        this.setVisible(false);
    }
     /*
    *
    * Metodo: getType
    * Funcionamento: retorna o tipo de pokemon, neste caso, tipo 4.
    */
    @Override
    public int getType(){
        return this.type;
    }
}
